<?php

// 连接数据库
function conn_mysql(){
    // 连接数据库
    $conn = new mysqli(HOST, DBUSER, DBPWD, DBNAME);

    if ($conn->connect_error){
        die('connect failed: ' . $conn->connect_error);
    }
    // 设置字符集
    $conn->set_charset('utf8');
    return $conn;

}

